﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Wicresoft.JDPostBoard.Entity;

public partial class PostBoard_PostDetail : BaseAuthenticationPage
{
    protected string PostID
    {
        get
        {
            return Request["PostID"];
        }
    }

    protected string OpenType
    {
        get
        {
            return Request["Type"];
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        this.UseTabber = true;
        if (!IsPostBack)
            LoadDataFromEntity();
    }

    protected void LoadDataFromEntity()
    {
        Post post = new Post(new Guid(PostID));
        post.Load();
        this.lbPostTitle.Text = post.PostTitle;
        this.lbPostContent.Text = post.PostContent;
        this.lbLinkAddress.Text = post.LinkAddress;
        this.lbPostTime.Text = post.PostTime.ToString();
        if (post.PosterID != CurrentUser.ID.ToString())
        {
            post.IsRead = true;
            post.Save();
        }
    }

    protected void btnRefresh_Click(object sender, EventArgs e)
    { 
    
    }
}
